<script type="text/javascript">
    window.onload = function () {

        let arr;
        let newArr;

        console.log('筛选arr中大于25的数据***start***');
        arr = [20, 22, 23, 25, 26, 28];
        console.log(arr);
        newArr = arr.filter(item => item > 25);
        console.log(newArr);
        console.log('***end***');

        console.log('筛选arr中包含a的数据***start***');
        arr = ['ab', 'ac', 'bc', 'bd', 'ad', 'cf'];
        console.log(arr);
        newArr = arr.filter(item => item.includes('a'));
        //newArr = arr.filter(item => item.indexOf('a') > -1);
        console.log(newArr);
        console.log('***end***');

        console.log('去掉空数组空字符串、undefined、null***start***');
        arr = [1, 'a', '', undefined, , null];
        console.log(arr);
        newArr = arr.filter(item => item);
        console.log(newArr);
        console.log('***end***');

    }
</script>